//
//  TJNetWorking+Image.m
//  PigMarket
//
//  Created by 张敬 on 2019/8/5.
//  Copyright © 2019年 pigmarket.oc. All rights reserved.
//

#import "TJNetWorking+Image.h"
#import "TokenCacheManager.h"
#import "UIDevice+KeychainIDFV.h"
#import "SystemUtil.h"

@implementation TJNetWorking (Image)

- (void)getMineVouchersListDatacallBack:(BusinessOperationCallback)callBack
{
    NSString *urlStr = NSStringFormat(URL_Server, URL_Image_Update);
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    
    UIImage *image = [UIImage imageNamed:@"login_logo"];
    NSData *data = UIImageJPEGRepresentation(image, 1.0f);
    NSString *encodedImageStr = [data base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
    
    NSDictionary *dic = @{@"img" : encodedImageStr,  @"type":@"png", @"fileName":@"aaaa"};
    [parameters setValue:@[dic] forKey:@"imgs"];
    [parameters setValue:@"15022632138" forKey:@"account"];
     [parameters setValue:@"61" forKey:@"memberId"];
    [parameters setValue:@"1" forKey:@"state"];
    urlStr = @"http://39.98.179.212:8686/pig-joggle/img/iosUploadImg";
    [self postResponseDataWithUrl:urlStr parameter:parameters callBack:callBack];
}


- (void)getMeatListDatacallBack:(BusinessOperationCallback)callBack
{
    NSString *urlStr = NSStringFormat(URL_Server, URL_Mine_Info);
    
    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
    [parameters setValue:@"61" forKey:@"memberId"];
    
   // [self postResponseDataWithUrl:urlStr parameter:parameters callBack:callBack];
    [self getResponseDataWithUrl:urlStr parameter:parameters callBack:callBack];
}


//个人中心：
- (void)getMineCenterDatacallBack:(BusinessOperationCallback)callBack
{
    NSString *urlStr = NSStringFormat(URL_Server, URL_MeatCity_List);
    
//    NSMutableDictionary *parameters = [NSMutableDictionary dictionary];
//    [parameters setObject:@1 forKey:@"page"];
//    [parameters setObject:@10 forKey:@"limit"];
//    [parameters setObject:@2 forKey:@"tribeId"];
//
    
    //urlStr = @"http://39.98.179.212:8686/pig-joggle/shopSearch/getShopByOther";
    
    NSString *deviceNum = [SystemUtil getUniqueId];
    urlStr = @"http://39.98.179.212:8686/pig-joggle/userCenter/getMemberPhoneList/";
    NSString *newUrl = [NSString stringWithFormat:@"%@%@", urlStr, deviceNum];
    
    
     NSLog(@"url = %@  参数：", newUrl);
    
    //[self postResponseDataWithUrl:urlStr parameter:parameters callBack:callBack];
    [self getResponseDataWithUrl:newUrl parameter:nil callBack:callBack];
}


@end
